import React from 'react';
import {

} from 'react-native';

import {ObjUtils} from '../../utils/Utils';
import HeartConstants from '../../common/HeartConstants';
import CommonDataEditListPage from '../common/CommonDataEditListPage';
import HeartLoveRquestUpdateSelfDataAction from '../../actions/heart/HeartLoveRquestUpdateSelfDataAction';

export default class HeartLoveContactDataPage extends CommonDataEditListPage {
  constructor(props) {
    super(props);

    this.state.statusText = "";
    this.state.viewStatus = 0;
    this._isShowSubmit = true;
    this._submitText = "保 存";
  }

  componentWillUpdate(nextProps, nextState) {
    this._checkUnAutorization(nextProps, nextState);
    if(this.state.statusText != nextState.statusText) {
      ToastUtils.show(nextState.statusText);
    }
  }

  _initPageButtonValues() {
    this._pageButtonValues = ObjUtils.copy(this.props.pageData.routeData.userData);
  }

  _getPageDatas() {
    return HeartConstants.totalData.contactData;
  }


    
  _onPressSubmit() {
    ToastUtils.show("请求已发送");
    new HeartLoveRquestUpdateSelfDataAction().call(this, this._pageButtonValues);
  }
}
